package com.qcby.Service.ServiceImpl;

import com.qcby.query.CityQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qcby.Mapper.CityMapper;
import com.qcby.Entity.City;
import com.qcby.Service.CityService;

import java.util.List;

@Service
public class CityServiceImpl implements CityService {

   @Autowired
   private CityMapper cityMapper;

    @Override
        public int deleteByPrimaryKey(Integer id) {
            return cityMapper.deleteByPrimaryKey(id);
        }

        @Override
        public int insert(City record) {
            return cityMapper.insert(record);
        }

        @Override
        public int insertSelective(City record) {
            return cityMapper.insertSelective(record);
        }

        @Override
        public City selectByPrimaryKey(Integer id) {
            return cityMapper.selectByPrimaryKey(id);
        }

        @Override
        public int updateByPrimaryKeySelective(City record) {
            return cityMapper.updateByPrimaryKeySelective(record);
        }

        @Override
        public int updateByPrimaryKey(City record) {
            return cityMapper.updateByPrimaryKey(record);
        }

        public List<CityQuery> getCityWithStations(){
        return cityMapper.getCityWithStations();
        }
        public int getCityNumByCityName(City city){
        return cityMapper.getCityNumByCityName(city);
        };
        public List<City> getAllCity(){
            return cityMapper.getAllCity();
        }
}
